package com.luoxc.mapper;

import com.luoxc.anno.MyNotLog;
import com.luoxc.pojo.Emp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {
    /**
     * 分页查询
     * */
//    @Select("select * from emp where name like concat('%',#{name},'%') and gender = #{gender} and entry_date between #{start} and #{end}")
    public List<Emp> list(String name, Short gender, LocalDate start, LocalDate end);
    void delete(List<Integer> ids);

    void add(Emp emp);

    Emp queryId(Integer id);

    void update(Emp emp);
    @MyNotLog
    @Select("select * from emp where username = #{username} and password = #{password}")
    Emp getUsernameAndPassword(Emp emp);
    @Select("delete from emp where dept_id = #{id}")
    void deleteDeptDd(Integer id);
}
